<div class="pay">
	<div class="paytitle">
		填写并核对订单信息
	</div>
	<div class="payitem">
		<div class="title">
			就餐形式：
		</div>
		<div class="instore">
			<div class="item">
				{{#if user.pay_ach.info.state!=$Top.config.ACH_STATE.未确认}}
					{{user.pay_ach.info.use_space?'店内就餐':'网购送货'}}
				{{#else}}
				店内就餐请在右侧打上勾 <input event-change="{{'$Event.pays.change_use_space'}}" type="checkbox" checked="{{user.pay_ach.info.use_space}}" />
				{{/if}}
			</div>
		</div>
	</div>
	<div class="choicetable {{user.pay_ach.info.use_space&&'focus'}}">
		<div class="payitem">
			{{#if user.pay_ach.info.state!=$Top.config.ACH_STATE.未确认}}
			<div class="title">
				桌号：{{user.pay_ach.info.space.name}}
			</div>
			{{#else}}
			<div class="title">
				请选择桌号
			</div>
			<div class="table">
				桌号：
				<select name="tablenum" value="{{user.pay_ach.info.space._id}}" bind-input="{{'user.pay_ach.info.space_id'}}" event-change="{{'$Event.pays.change_space'}}">
					<option value="">请选择餐桌号</option>
					{{#each $Cache.pay.space_seat.list}}
					{{#if use_state==$Top.config.SPACE_USE_STATE.可用}}
					<option id="{{_id}}" value="{{_id}}">{{name}}</option>
					{{/if}}
					{{/each}}
				</select>
				<!-- <button event-click="{{'$Event.choice_table_num'}}">
					确定
				</button> -->
			</div>
			{{/if}}
		</div>
	</div>
	<div class="choiceaddr {{user.pay_ach.info.use_space&&'focus'}}">
		<div class="payitem">
			<div class="title">
				收货信息
			</div>
			<div class="useraddr">
				<p>当前选择的收货地址</p>
				<span>
					{{user.pay_ach.info.user_address.name}}，
					{{user.pay_ach.info.user_address.mobilenumber}}，
					{{user.pay_ach.info.user_address.province}}
					{{user.pay_ach.info.user_address.town}}
					{{user.pay_ach.info.user_address.county}}，
					{{user.pay_ach.info.user_address.detail}}
				</span>
			</div>
			{{#if user.pay_ach.info.state==$Top.config.ACH_STATE.未确认}}
			{{#each user.address_detail}}
			<div class="addr"><label style="cursor: pointer;">
				<input type="radio" name="addr" checked="{{$Top.user.pay_ach.info.user_address._id}}" value="{{_id}}" event-click="{{'$Top.$Event.pays.change_user_address'}}"/>
				<span>
				{{name}}，{{mobilenumber}} {{phonenumber&&("/"+phonenumber)}}，{{province}}{{town}}{{county}}，{{detail}}</span></label>
			</div>
			{{/each}}
			<div class="add_addr">
				<div class="text">
					<select class="province" name="province" event-change={{'$Event.province'}}>
						<option class="first" value="0">请选择省</option>
						{{#each city_list}}
							<option rel="{{region_id}}" value="{{region_name}}">
								{{region_name}}
							</option>
						{{/each}}
					</select>
	
					<select class="city" name="city" disabled event-change={{'$Event.city'}}>
						<option class="first" value="0">请选择市</option>
					</select>
	
					<select class="county" name="area" disabled>
						<option class="first" value="0">请选择地区</option>
					</select>
					<input type="text" class="detailed_addre" title="详细地址" name="detailed_addre" placeholder="详细地址" maxlength="30" />
					<input type="text" name="name" class="name" placeholder="收货人" title="收货人" maxlength="12" />
					<input type="text" name="mobile_num" class="mobile_num" title="联系手机" placeholder="联系手机" maxlength="11" />
					<input type="text" name="phone_num" title="座机号码" class="phone_num" placeholder="座机号码" maxlength="11" />
				</div>
				<button event-click="{{'$Event.add_user_address'}}">
					添加地址
				</button>
			</div>
			{{/if}}
		</div>
	</div>
	
	<div class="payitem">
		<div class="title">
			支付方式：
			{{#if user.pay_ach.info.pay_method=="partner_trade_by_buyer"}}
			使用支付宝的快捷支付
			{{/if}}
			<!-- {{#if user.pay_ach.info.pay_method=="payment_in_cash"}}
			货到付款
			{{/if}} -->
			{{#if user.pay_ach.info.pay_method=="face_pay"}}
			现金付款
			{{/if}}
			{{#if user.pay_ach.info.pay_method=="weixin_pay"}}
			微信支付
			{{/if}}
		</div>
		{{#if user.pay_ach.info.state==$Top.config.ACH_STATE.未确认}}
			<div class="pay-type"><label style="cursor: pointer;">
				<input checked="{{user.pay_ach.info.pay_method}}" type="radio" bind-input="{{'$Cache.pays.buy_method'}}" name="pay-type" value="partner_trade_by_buyer" event-change="{{'$Event.pays.change_pay_method'}}" disabled="{{!(bus_info.info.alipay.seller_email&&bus_info.info.alipay.key&&bus_info.info.alipay.partner)}}"/>支付宝
				<span>使用支付宝的快捷支付</span></label>
			</div>
			<!-- <div class="pay-type"><label style="cursor: pointer;">
				<input checked="{{user.pay_ach.info.pay_method}}" type="radio" bind-input="{{'$Cache.pays.buy_method'}}" name="pay-type" value="payment_in_cash" event-change="{{'$Event.pays.change_pay_method'}}" disabled="{{bus_info.permission.can_only_online_pay}}" />货到付款
				<span>用于大金额订单</span></label>
			</div> -->
			<div class="pay-type"><label style="cursor: pointer;">
				<input checked="{{user.pay_ach.info.pay_method}}" type="radio" bind-input="{{'$Cache.pays.buy_method'}}" name="pay-type" value="face_pay" event-change="{{'$Event.pays.change_pay_method'}}" disabled="{{bus_info.permission.can_only_online_pay}}" />现金付款
				<span>现金当面付款</span></label>
			</div>
			<div class="pay-type"><label style="cursor: pointer;">
				<input checked="{{user.pay_ach.info.pay_method}}" type="radio" bind-input="{{'$Cache.pays.buy_method'}}" name="pay-type" value="weixin_pay" event-change="{{'$Event.pays.change_pay_method'}}" disabled="{{bus_info.permission.can_only_online_pay}}" />微信支付
				<span>使用微信扫描支付</span></label>
			</div>
			<!-- <div class="pay-type">
				<input type="radio" name="pay-type" value="1" />邮局汇款
				<span>通过快钱平台收款 汇款后1-3个工作日到账</span>
			</div> -->
		{{/if}}
	</div>
	
	<div class="payitem">
		<div class="title">
			商品清单
		</div>
		<table class="list">
			<thead>
				<td class="goods">商品</td>
				<td class="price">价格</td>
				<td class="num">数量</td>
			</thead>
			{{#each user.pay_ach.info.goods_info}}
			<tr>
				<td>
					<div>
					<a target="_blank" href="#default/detail?id={{goods._id}}">{{goods.goods_name}}</a>
					</div>
					<div>
						商品编号：{{goods._id}}
					</div>
				</td>
				<td>{{#Fixed goods.price}}</td>
				<td>{{num}}</td>
			</tr>
			{{/each}}
			<tr>
				<td colspan="3">
					<div class="total">
						<div class="item">
							<div class="il">总金额：</div>
							<div class="ir">
							{{#Fixed user.pay_ach.sou_cash}}
							</div>
						</div>
						<div class="item">
							<div class="il">打折优惠：</div>
							<div class="ir">
							{{#Fixed (user.pay_ach.sou_cash-(user.pay_ach.cash+user.pay_ach.bind_acc||0))||0}}
							</div>
						</div>
						<div class="item">
							<div class="il">推荐返利金额抵消：</div>
							<div class="ir">
							{{#Fixed (user.pay_ach.bind_acc)||0}}
							</div>
						</div>
						<div class="item">
							<div class="il">应付金额：</div>
							<div class="ir">
							{{#if user.pay_ach.cus_cash}}
								<span>
								<del>{{#Fixed user.pay_ach.cash}}</del>
								改：{{#Fixed user.pay_ach.cus_cash}}
								</span>
							{{#else}}
								<span>{{#Fixed user.pay_ach.cash}}</span>
							{{/if}}
							</div>
						</div>
					</div>
				</td>
			</tr>
		</table>
	</div>
	<div class="payitem">
		<div class="coupon">
		{{#if user.pay_ach.coupon_id}}
			使用优惠码：{{user.pay_ach.coupon_id}}
		{{#else}}
			{{#if user.pay_ach.info.state==$Top.config.ACH_STATE.未确认}}
			<label for="coupon">请输入优惠码：
				<input type="text" class="android" value="{{$Cache.pay_ach.coupon_id}}" bind-input="{{'$Cache.pay_ach.coupon_id'}}">
				<button event-click="{{'$Event.pay_ach.bind_coupon'}}">绑定优惠码</button>
				<i>绑定优惠码后不能再修改订单</i>
			</label>
			{{/if}}
		{{/if}}
		<div class="bus_bind">
		{{#if user.pay_ach.bind_acc}}
			使用 <b>推荐返利</b> 的抵消金额：￥<span>{{#Fixed user.pay_ach.bind_acc}}</span>
		{{#else}}
			{{#if $Cache.bus_bind._money>0}}
				使用抵扣金额（可用抵扣金额：<span>{{#Fixed $Cache.bus_bind._money}}</span>）：
				<inputnumber min="0" max="{{(user.pay_ach.cus_cash||user.pay_ach.cash)>$Cache.bus_bind._money?$Cache.bus_bind._money:(user.pay_ach.cus_cash||user.pay_ach.cash)}}" fixed="2" bind-input="{{'$Cache.pay_ach.bind_acc'}}"></inputnumber>
				<button event-click="{{'$Event.pay_ach.bind_acc'}}">确定抵扣金额</button>
				<i>确定后不能再修改抵扣额度</i>
			{{#else}}
				<i>无可用的抵扣金额（来自推荐返利）</i>
			{{/if}}
		{{/if}}
		</div>
	</div>
	<div class="topay">
		{{#> "user_ach_controller","user.pay_ach"}}
	</div>
	<div class="block"></div>
</div>

<link rel="stylesheet" type="text/css" href="/css/catering/pc_pay.css" />